#ifndef ROTOR_H
#define ROTOR_H

#include <QByteArray>
#include <QMap>
#include <QList>

class Rotor
{
public:
    Rotor();

    void setRotorPhase(char ch);
    void setRotorNotch(char ch);
    void setRotorLetters(const QByteArray &letters);
    void setRotorNext(Rotor *next);
    void rotate();
    char getRotorChar(char ch);
    char getRotorCharReversed(char ch);

private:
    Rotor *m_next;
    int m_cursor;
    QList<int> m_notchs;
    QByteArray m_letters;
    QByteArray m_reversedLetters;
};

class Plugboard : public Rotor
{
public:
    Plugboard();
    void setPlugboardPairs(const QMap<char, char> &pairs);
};

class Reflector : public Plugboard
{
public:
    Reflector();
    void setReflectorPairs(const QMap<char, char> &pairs);
};

class RotorI : public Rotor
{
public:
    RotorI();
};

class RotorII : public Rotor
{
public:
    RotorII();
};

class RotorIII : public Rotor
{
public:
    RotorIII();
};

class RotorIV : public Rotor
{
public:
    RotorIV();
};

class RotorV : public Rotor
{
public:
    RotorV();
};

class RotorVI : public Rotor
{
public:
    RotorVI();
};

class RotorVII : public Rotor
{
public:
    RotorVII();
};

class RotorVIII : public Rotor
{
public:
    RotorVIII();
};

class ReflectorB : public Reflector
{
public:
    ReflectorB();
};

class ReflectorC : public Reflector
{
public:
    ReflectorC();
};

#endif // ROTOR_H
